//将href中的参数转换为对象形式输出
export const getHrefParams =() => {
    let str =decodeURIComponent(window.location.href);
    let arr = str.split('?');
    let equeryArr = [];
    let toObj = [];
    let obj = {};
    if(arr.length == 2){
        equeryArr = arr[1].split("&");
        for(let i = 0; i < equeryArr.length; i++){
            toObj.push(equeryArr[i].split('=')[0]);
            toObj.push(equeryArr[i].split('=')[1]);
        }
        for(let j = 0; j < toObj.length; j++){
            if(j % 2 === 0){
                let str = toObj[j];
                obj[str] = toObj[j+1];
            }
        }
    }
    return obj;
}